#ifndef BASE_API_H_
#define BASE_API_H_

#include <stdint.h>
#include <stdio.h>
#include <error.h>

#ifdef USE_DEBUG
#define DEBUG_LINE() printf("[%s:%s] line=%d \n",__FILE__, __func__, __LINE__)
#define DEBUG_ERR(fmt, args...) printf("[%s:%d] "#fmt" errno=%d, %m \n", __func__, __LINE__, ##args, errno)
#define DEBUG_INFO(fmt, args...) printf("[%s:%d] "#fmt" \n", __func__, __LINE__, ##args)
#else
#define DEBUG_LINE()
#define DEBUG_ERR(fmt, ...)
#define DEBUG_INFO(fmt, ...)
#endif

void WriteReg(uint64_t addr ,uint64_t value);
int SelectChip(uint64_t ChipNum);
void rocc_config(uint32_t random,uint32_t wisenum,uint32_t outshift,uint32_t cimshift);
void rocc_push(int8_t* data_in,uint32_t push_start,uint32_t push_num);
void rocc_mvm(uint32_t array_index,uint32_t mvm_row_start,uint32_t mvm_row_num,
              uint32_t mvm_col_start,uint32_t mvm_col_num);
void rocc_save(int8_t* data_out,uint32_t save_start,uint32_t save_num);


#endif